package com.samphanie.auiu.auth.security.service;

import com.samphanie.auiu.auth.feign.IThirdPartyService;
import com.samphanie.auiu.auth.validation.code.captcha.sms.ISmsCodeSenderService;
import com.samphanie.auiu.common.dto.SendSmsDto;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.stereotype.Service;

/**
 * @author ZSY
 * @email 1451691457@qq.com
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class SmsCodeSenderImpl implements ISmsCodeSenderService {

    private final IThirdPartyService thirdPartyService;

    @Override
    public void send(String key, String mobile, String params) {
        val sendSms = SendSmsDto.builder()
                .key(key)
                .mobile(mobile)
                .message(params)
                .build();
        thirdPartyService.sendSmsCode(sendSms);
    }

}
